/*
-------------------------------------------------------------------
BIE is Copyright 2001-2003 Brunswick Corp.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/bie_license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
*/
package com.webdeninteractive.sbie.v1_1.util.xmlsvelte;

import java.io.OutputStream;
import java.io.IOException;
import org.w3c.dom.Document;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
import java.io.ByteArrayOutputStream;


public class DOMDumper {

    public static void dump( Document doc, OutputStream out)
        throws IOException
    {
        dump( doc, out, "utf-8" );
    }

    public static void dump( Document doc, OutputStream out, String encoding )
        throws IOException
    {
        OutputFormat of = new OutputFormat( doc, encoding, true );
        of.setOmitXMLDeclaration(true);
        XMLSerializer grapenuts = new XMLSerializer( out, of );
        grapenuts.serialize(doc);
    }
    

}
